<template>
  <div class="container">
    <!-- 头部 -->
    <Head @change="headChange"/>

    <!-- 内容 -->
    <el-row :gutter="15">
      <!-- 左边的布局 -->
      <transition name="show">
        <el-col :md="{span:5}" v-if="show">
          <Left/>
        </el-col>
      </transition>

      <!-- 右边的内容 -->
      <el-col :md="{span:19}">
        <nuxt />
      </el-col>
    </el-row>

    <!-- 到达顶部-->
    <BackToTop/>
  </div>
</template>

<script>
  import Head from './head.vue'
  import Left from './left.vue'
  import BackToTop from '@/components/BackToTop.vue'
  export default{
    layout: 'default',
    components:{
      Head,
      Left,
      BackToTop
    },
    data(){
      return {
          show: true
      }
    },
    methods: {
      headChange(show){
        this.show = show;
      }
    }
  }
</script>

<style lang="scss">
  @import '@/assets/css/index.scss';
  .show-enter-active, .show-leave-active {
    transition: transform .5s;
  }
  .show-enter, .show-leave-to{
    transform: translate3d(100%,0,0);
  }
</style>
